package com.example.time_manage_web.controller;

import com.example.time_manage_web.pojo.Count;
import com.example.time_manage_web.pojo.Focus;
import com.example.time_manage_web.service.FocusService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @BelongsProject: time_manage_web
 * @BelongsPackage: com.example.time_manage_web.controller
 * @Author: fox
 * @CreateTime: 2023-03-29  18:45
 * @Description: TODO
 * @Version: 1.0
 */
@RestController
@RequestMapping("/api")
public class FocusController {

    @Autowired
    private FocusService focusService;

    @GetMapping("/focusquery")
    public List<Focus> query(){
        return this.focusService.queryfocus();
    }

    @PostMapping("/focusadd")
    public int add(Focus focus){
        int a= this.focusService.insert(focus);
        return a;
    }
}
